package etnorservice.etnor_service.utils;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;
import java.util.Map;

public class JsonUtil {

    private static final ObjectMapper objectMapper = new ObjectMapper();

    /**
     * 将JSON字符串转换为Map对象。
     * @param jsonString JSON字符串
     * @return 转换后的Map对象
     * @throws IOException 如果解析失败
     */
    public static Map<String, Object> jsonStringToMap(String jsonString) throws IOException {
        return objectMapper.readValue(jsonString, Map.class);
    }
}
